<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑知识库</title>
    <link rel="stylesheet" href="/static/bootstrap.min.css">
</head>
<body>
    <div class="container mt-4">
        <h2>编辑知识库</h2>
        <form action="{{ url_for('edit_knowledge_base', id=knowledge_base[0]) }}" method="post">
            <div class="mb-3">
                <label for="title" class="form-label">标题</label>
                <input type="text" class="form-control" id="title" name="title" value="{{ knowledge_base[1] }}" required>
            </div>
            <div class="mb-3">
                <label for="remark" class="form-label">备注</label>
                <textarea class="form-control" id="remark" name="remark">{{ knowledge_base[2] }}</textarea>
            </div>
            <div class="mb-3">
                <label for="sort" class="form-label">排序</label>
                <input type="number" class="form-control" id="sort" name="sort" value="{{ knowledge_base[3] }}" required>
            </div>
            <div class="mb-3 form-check">
                <input type="checkbox" class="form-check-input" id="enabled" name="enabled" {{ 'checked' if knowledge_base[4] else '' }}>
                <label class="form-check-label" for="enabled">启用</label>
            </div>
            <button type="submit" class="btn btn-primary">保存更改</button>
            <a href="{{ url_for('docmanage') }}" class="btn btn-secondary">取消</a>
        </form>
    </div>
</body>
</html>